﻿<div class="fitem_auto padding_H" id="Root">
    <div v-show="msg" class="msgbox_alert">{{msg}}</div>
    <div v-show="active">
        <buttonlist :hook="hooks[0]" :set="sets0" class="wyjcontainer_H border_B padding_V"></buttonlist>
        <pagenation :hook="hooks[1]" :set="listMain" :api="Api">
            <template #td="models">
                <td><a class="tooltip" @@click="Switch(3, models.model)">{{models.model.Id}}<span class="tooltiptext">查看详情</span></a></td>
                <td>{{models.model.UnitName}}</td>
                <td>{{models.model.Result}}</td>
                <td>{{models.model.Done}}</td>
                <td>
                    <a v-for="(btn,i) in icons" :key="i" :class="btn.class" @@click="btn.act(models.model)"><i :class="btn.icon"></i></a>
                </td>
            </template>
        </pagenation>
    </div>
</div>
<canvas id="live2dcanvas" width="300" height="600" style="position: fixed; opacity: 0.7; left: 0px; bottom: 0px; z-index: 99999; pointer-events: none;"></canvas>
@section foot {
    <script type="text/javascript">
        var app = new App({
            Api: 'Test',
                PageTitles:['','','',''],
            sets0: {
                btns: [{
                        text: " 刷新",
                        icon:'fa fa-refresh',
                        class: "btn btn_info",
                        event:'btnRefresh'
                    }],                    
                preText: '单元测试'
            },
            listMain:{
                titles: ["ID", "单元名称", "测试值", "是否成功", "操作"],
            },
            icons: [{
                icon: 'fa fa-trash',
                act: (e, i) => {
                    app.DeleteById(e.Id, i)
                }
            }, {
                icon: 'fa fa-pencil-square-o',
                act: (e) => {
                    app.Switch(2, e);
                }
            }, {
                icon: 'fa fa-eye',
                act: (e) => {
                    app.Switch(3, e);
                }
            }],
        });
        app.on('btnRefresh', e => {
            Ajax.get("/api/Test/GetList?pageIndex=1&pageSize=10&key=", res => {
                Store.set("errinfo", { tbody: res });
            });
        });

    </script>
}
